package com.zlx.exchange.type.controller;


import com.zlx.exchange.domain.dto.TypeDTO;
import com.zlx.exchange.type.service.TypeService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (Type)表控制层
 *
 * @author makejava
 * @since 2023-09-04 20:18:18
 */
@RestController
@RequestMapping("api/type")
public class TypeController {
    /**
     * 服务对象
     */
    @Resource
    private TypeService typeService;

    @GetMapping
    public ResponseEntity<Object> queryTypeByJson(TypeDTO typeDTO){
        return ResponseEntity.ok(typeService.queryTypeByJson(typeDTO));
    }
    @GetMapping
    public ResponseEntity<Object> queryCategory(){
        return  ResponseEntity.ok(typeService.queryCategory());
    }
    @GetMapping
    public ResponseEntity<Object> queryType(Integer categoryId){
        return  ResponseEntity.ok(typeService.queryType(categoryId));
    }
}

